@extends('default.layouts.adminPublic')
@section('title', '招聘会修改')
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/admin/indexList.css')}}">
    <link rel="stylesheet" href="{{asset('/vendor/jedate/skin/jedate.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/admin/jobFair.css')}}">
    @endsection
    @section('content')
            <!--导航开始-->
    <div class="crumb_warp">
        <i class="fa fa-home"></i> <a href="{{url('admin')}}">首页</a> &raquo; 招聘会管理
    </div>
    <!--导航结束-->
    <!--列表开始-->

    <div class="result_wrap">
        <div class="result_title">
            <h3>招聘会列表 <em class="red">{{ session("message") }}</em></h3>
            @include('flash::message')
        </div>
        <!--快捷导航 开始-->
        <div class="result_content">
            <div class="short_wrap">
                <a href="{{ url('admin/job_fair/') }}"><i class="fa fa-mail-reply"></i>招聘会管理</a>
                <a href="{{ url('admin/job_fair/create') }}"><i class="fa fa-plus"></i>添加招聘会</a>
            </div>
        </div>
        <div class="con">
            <div class="conMain">
                <div class="manage" style="padding: 0; margin-bottom: 10px;">
                    @if(count($errors)>0)
                        <div class="mark">
                            @if(is_object($errors))
                                @foreach($errors->all() as $error)
                                    <p>{{$error}}</p>
                                @endforeach
                            @else
                                <p>{{$errors}}</p>
                            @endif
                        </div>
                    @endif
                </div>
            </div>
        </div>
    </div>
    <!--快捷导航 结束-->
    <form action="{{ url('/admin/job_fair/'.$recruitment->id) }}" onsubmit="return checkForm('#jobFairForm')" method="post" name="jobFairForm" id="jobFairForm">
        <div class="result_wrap border_buttom">
            {{csrf_field()}}
            <input type="hidden" name="_method" value="put">

            <ul class="list_tab make">
                <li class="create-li">
                    <span class="left">招聘会名称：</span>
                    <span class="right"><input type="text" style="width:600px;" name="job_title"
                                               value="{{ $recruitment->job_title }}"></span>
                </li>
                <li class="create-li">
                    <span class="left">举办时间：</span>
                    <span class="right">
                        <input class="wicon" name="hold_time" style="width:180px;" id="hold_time"
                               value="{{$recruitment->hold_time}}" type="text" readonly>
                        {{--<input type="text" name="hold_time" value="{{ old('hold_time') }}">--}}
                        </span>
                </li>
                <li class="create-li">
                    <span class="left">举办点数：</span>
                    <span class="right"><input type="text" name="hold_pm" value="{{ $recruitment->hold_pm }}"></span>
                    <span class="news-err"><span class="notice">准确时间点数：上午，下午，晚上</span></span>
                </li>
                <li class="create-li">
                    <span class="left">举办单位：</span>
                    <span class="right"><input type="text" style="width:600px;" name="hold_unit"
                                               value="{{ $recruitment->hold_unit}}"></span>
                </li>
                <li class="create-li">
                    <span class="left">举办地点：</span>
                    <span class="right"><input type="text" style="width:600px;" name="hold_address"
                                               value="{{ $recruitment->hold_address }}"></span>
                </li>

                <li class="create-li">
                    <span class="left">联系电话：</span>
                    <span class="right"><input type="text" name="phone" value="{{ $recruitment->phone }}"></span>
                </li>
                <li class="create-li border_buttom">
                    <span class="left">设置订展：</span>
                    <span class="right">
                        <input class="labelinput" type="radio" checked id="exhibition1" name="exhibition" value="1">
                        <label for="exhibition1">开启订展</label>
                        <input class="labelinput" type="radio" id="exhibition2" name="exhibition" value="2">
                        <label for="exhibition2">关闭订展</label>
                   </span>
                </li>
                <li class="create-li border_buttom">
                    <span class="left">招聘会类型：</span>
                    <span class="right">
                        <input class="labelinput" type="radio" checked id="recruitment_type1" name="recruitment_type"
                               value="1">
                        <label for="recruitment_type1">普通招聘</label>
                        <input class="labelinput" type="radio" id="recruitment_type2" name="recruitment_type" value="2">
                        <label for="recruitment_type2">校园招聘</label>
                   </span>
                </li>
                <li class="create-li">
                    <span class="left">坐标经度：</span>
                    <span class="right"><input type="text" name="longitude"
                                               value="{{ $recruitment->longitude }}"></span>
                </li>
                <li class="create-li">
                    <span class="left">坐标纬度：</span>
                    <span class="right"><input type="text" name="latitude" value="{{ $recruitment->latitude }}"></span>
                </li>

            </ul>
            <div class="attend">
                <div class="left">参会企业：</div>
                <div class="rcontent"><textarea name="to_attend">{{ $recruitment->to_attend}}</textarea></div>
            </div>
            <div class="bbs">
                <script id="editor" type="text/plain"
                        style="width:100%;min-height:250px;line-height:20px;">{!! $recruitment->job_details !!}</script>
                <div class="submit-left"><input type="hidden" name="img_tag" value="{{ $recruitment->img_tag }}"></div>
            </div>
            <div class="news-submit">
                <div class="submit-right">
                    <input type="submit" value="提 交">
                    <input type="button" class="back" onclick="history.go(-1)" value="返回">
                </div>
            </div>
        </div>
    </form>
@endsection

@section('footerjs')
    @parent
    <script>
        var UPLOADER_URL = '{{url('/')}}';
        var uplod_url = "/admin/upload_url?img_tag={{ $recruitment->img_tag }}";
    </script>
    <script type="text/javascript" src="{{asset('/vendor/jedate/jquery.jedate.min.js')}}"></script>
    <script type="text/javascript" charset="utf-8" src="{{asset('/vendor/ueditor/ueditor.config.js')}}"></script>
    <script type="text/javascript" charset="utf-8" src="{{asset('/vendor/ueditor/ueditor.all.min.js')}}"></script>
    <script type="text/javascript" charset="utf-8" src="{{asset('/vendor/ueditor/lang/zh-cn/zh-cn.js')}}"></script>
    <script type="text/javascript" src="{{asset('/vendor/jedate/jquery.jedate.min.js')}}"></script>
    <script type="text/javascript">
        var ue = UE.getEditor('editor', {textarea: 'job_details'});
        ue.ready(function(){
            ue.execCommand('serverparam', '_token', '{{ csrf_token() }}');
        });
        //蓝色风格
        $.jeDate('#hold_time', {
            isinitVal: true,
            format: 'YYYY-MM-DD',
            festival: true
        });
        $(function(){
            $("#jobFairForm").find("input[name='exhibition'][value='{{$recruitment->exhibition}}']").attr("checked", true);
            $("#jobFairForm").find("input[name='recruitment_type'][value='{{$recruitment->recruitment_type}}']").attr("checked", true);
        });
    </script>
@endsection